<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			.list li{
				height: 30px;
				background: red;
				list-style: none;
			}
			.list li:nth-child(2n){
				background: blue;
			}
			.active li{
				background: blue;
			}
			.active li:nth-child(2n){
				background: red;
			}
		</style>
		<script src="js/jquery-3.6.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(function(){
				setInterval(function(){
					$(".list").toggleClass("active");
				},1000)
			})
		</script>
	</head>
	<body>
		<ul class="list active">
			<li>1</li>
			<li>2</li>
			<li>3</li>
			<li>4</li>
			<li>5</li>
			<li>6</li>
			<li>7</li>
			<li>8</li>
			<li>9</li>
		</ul>
	</body>
</html>
